from rrDefine import *

#*******************************************************************************
#
#	DICE
#
#*******************************************************************************

class Dice:
	def __init__(self,n,s,x):
		self.n=n #number of dice
		self.s=s #number of side
		self.x=x #+X
	def roll(self):
		#roll NdS+X
		score=0
		for i in range(self.n):
			score+=random.randint(1,self.s)		
		score+=self.x
		if score>=0:
			return score
		else:
			return 0	
	
	def toString(self):
		return str(self.n)+"d"+str(self.s)+"+"+str(self.x)
